package com.cgy.repository;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.cgy.entity.Student;
import com.cgy.entity.Teacher;

public interface TeacherRepository extends JpaRepository<Teacher, Integer>,JpaSpecificationExecutor<Teacher>{
	@Query(value = "delete from Teacher WHERE tid=?1")  
    @Modifying 
    @Transactional 
	Integer deleteTeacher(Integer tid);
	//验证卡号是否存在
	@Query(value = "select *  from Teacher WHERE t_card_id=?1",nativeQuery = true)  
	List<Teacher> findLikecard(Integer tcardid);
}
